/*
 * Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
 

package org.dromara.maxkey.configuration;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Component
@Configuration
public class AuthJwkConfig {

    @Value("${maxkey.auth.jwt.expires:28800}")
    int     expires;
    
    @Value("${maxkey.auth.jwt.secret}")
    String     secret;
    
    @Value("${maxkey.auth.jwt.refresh.expires:86400}")
    int     refreshExpires;
    
    @Value("${maxkey.auth.jwt.refresh.secret}")
    String     refreshSecret;
    
    @Value("${maxkey.auth.jwt.issuer:https://sso.maxkey.top/}")
    String     issuer;

    public AuthJwkConfig() {
        super();
    }

    public String getIssuer() {
        return issuer;
    }

    public void setIssuer(String issuer) {
        this.issuer = issuer;
    }


    public int getExpires() {
        return expires;
    }

    public void setExpires(int expires) {
        this.expires = expires;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }
    
    public int getRefreshExpires() {
        return refreshExpires;
    }

    public void setRefreshExpires(int refreshExpires) {
        this.refreshExpires = refreshExpires;
    }

    public String getRefreshSecret() {
        return refreshSecret;
    }

    public void setRefreshSecret(String refreshSecret) {
        this.refreshSecret = refreshSecret;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("AuthJwkConfig [issuer=");
        builder.append(issuer);
        builder.append(", expires=");
        builder.append(expires);
        builder.append(", secret=");
        builder.append(secret);
        builder.append("]");
        return builder.toString();
    }
    
}
